package dao;

import domain.TestJava;
import domain.TestJavaExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Repository
public interface TestJavaMapper {
    long countByExample(TestJavaExample example);

    int deleteByExample(TestJavaExample example);

    @Delete({
        "delete from test_java",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into test_java (id, student_id, ",
        "test_date, grade)",
        "values (#{id,jdbcType=INTEGER}, #{studentId,jdbcType=INTEGER}, ",
        "#{testDate,jdbcType=DATE}, #{grade,jdbcType=REAL})"
    })
    int insert(TestJava record);

    int insertSelective(TestJava record);

    List<TestJava> selectByExample(TestJavaExample example);

    @Select({
        "select",
        "id, student_id, test_date, grade",
        "from test_java",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("dao.TestJavaMapper.BaseResultMap")
    TestJava selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") TestJava record, @Param("example") TestJavaExample example);

    int updateByExample(@Param("record") TestJava record, @Param("example") TestJavaExample example);

    int updateByPrimaryKeySelective(TestJava record);

    @Update({
        "update test_java",
        "set student_id = #{studentId,jdbcType=INTEGER},",
          "test_date = #{testDate,jdbcType=DATE},",
          "grade = #{grade,jdbcType=REAL}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(TestJava record);
}